Answers for "what is object php"

PHP
7

php define object

$x = new stdClass();
Posted by: Guest on February-19-2020
-1

java php object

$a = array('foo' => 'bar');
$o = (object) $a;
var_dump($o instanceof stdClass); // bool(true)
var_dump($o->foo); // string(3) "bar"
Posted by: Guest on May-08-2020
2

php object example

<?php
class Bike
{
    function model()
    {
        $model_name = 'cd100';
        echo "bike model:$model_name";
    }
}
$obj = new Bike();
$obj->model();
?>
Posted by: Guest on September-03-2021

Browse Popular Code Answers by Language