Answers for "php field as class object"

PHP
0

object php

//object init
  $object = (object) [
    'propertyOne' => 'foo',
    'propertyTwo' => 42,
  ];
Posted by: Guest on June-16-2020
1

declare variable in php class

<?php
class SimpleClass
{
   public $var1 = 'hello';
}
?>
Posted by: Guest on October-24-2020

Browse Popular Code Answers by Language