3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct() { echo '__construct'; } public function __call($name, $arguments) { echo $name . ' ' . implode(', ', $arguments); } public static function __callStatic($name, $arguments) { echo '(static) ' . $name . ' ' . implode(', ', $arguments); } public function __get($name) { echo '__get '; return $this->$name; } public function __set($name, $value) { echo '__set '; $this->$name = $value; } public function __isset($name) { echo "Est-ce que '$name' est défini ?\n"; return isset($this->$name); } public function __unset($name) { echo "Effacement de '$name'\n"; //unset($this->$name); } public function __destruct() { echo '__destruct'; } } $foo = new Foo(); // __construct /* $foo->undefinedMethod('arg1', 'arg2'); // undefinedMethod arg1, arg2 $foo::undefinedMethod('arg1'); // (static) undefinedMethod arg1 echo $foo->name; // __get Foo var_dump(isset($foo->name)); // bool(true)*/ $foo->name = 'Foo'; // __set unset($foo->name); var_dump(isset($foo->name)); // bool(true) //unset($foo); // __destruct ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UWnAW
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   62     3        ASSIGN_OBJ                                               !0, 'name'
          4        OP_DATA                                                  'Foo'
   64     5        UNSET_OBJ                                                !0, 'name'
   65     6        INIT_FCALL                                               'var_dump'
          7        ISSET_ISEMPTY_PROP_OBJ                           ~5      !0, 'name'
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                                 
   70    10      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UWnAW
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     '__construct'
    8     1      > RETURN                                                   null

End of function __construct

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UWnAW
function name:  __call
number of ops:  10
compiled vars:  !0 = $name, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        CONCAT                                           ~2      !0, '+'
          3        INIT_FCALL                                               'implode'
          4        SEND_VAL                                                 '%2C+'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $3      
          7        CONCAT                                           ~4      ~2, $3
          8        ECHO                                                     ~4
   13     9      > RETURN                                                   null

End of function __call

Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UWnAW
function name:  __callStatic
number of ops:  11
compiled vars:  !0 = $name, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        CONCAT                                           ~2      '%28static%29+', !0
          3        CONCAT                                           ~3      ~2, '+'
          4        INIT_FCALL                                               'implode'
          5        SEND_VAL                                                 '%2C+'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $4      
          8        CONCAT                                           ~5      ~3, $4
          9        ECHO                                                     ~5
   18    10      > RETURN                                                   null

End of function __callstatic

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UWnAW
function name:  __get
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   22     1        ECHO                                                     '__get+'
   23     2        FETCH_OBJ_R                                      ~1      !0
          3      > RETURN                                                   ~1
   24     4*     > RETURN                                                   null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UWnAW
function name:  __set
number of ops:  6
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   28     2        ECHO                                                     '__set+'
   29     3        ASSIGN_OBJ                                               !0
          4        OP_DATA                                                  !1
   30     5      > RETURN                                                   null

End of function __set

Function __isset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UWnAW
function name:  __isset
number of ops:  8
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   34     1        ROPE_INIT                                     3  ~2      'Est-ce+que+%27'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%27+est+d%C3%A9fini+%3F%0A'
          4        ECHO                                                     ~1
   35     5        ISSET_ISEMPTY_PROP_OBJ                           ~4      !0
          6      > RETURN                                                   ~4
   36     7*     > RETURN                                                   null

End of function __isset

Function __unset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UWnAW
function name:  __unset
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   RECV                                             !0      
   40     1        ROPE_INIT                                     3  ~2      'Effacement+de+%27'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%27%0A'
          4        ECHO                                                     ~1
   43     5      > RETURN                                                   null

End of function __unset

Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UWnAW
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   ECHO                                                     '__destruct'
   48     1      > RETURN                                                   null

End of function __destruct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.54 ms | 1404 KiB | 17 Q