3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { protected $bar; public function setBar ($val) { $this->bar = $val; } public function __get ($var) { return $this->$var; } } $obj = new foo (); $obj->setBar ('Hello World'); var_dump($obj->bar); $a = $obj->bar; var_dump(empty($a)); //fucking brilliant!
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s30ds
function name:  (null)
number of ops:  17
compiled vars:  !0 = $obj, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   16     3        INIT_METHOD_CALL                                         !0, 'setBar'
          4        SEND_VAL_EX                                              'Hello+World'
          5        DO_FCALL                                      0          
   18     6        INIT_FCALL                                               'var_dump'
          7        FETCH_OBJ_R                                      ~6      !0, 'bar'
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                                 
   20    10        FETCH_OBJ_R                                      ~8      !0, 'bar'
         11        ASSIGN                                                   !1, ~8
   23    12        INIT_FCALL                                               'var_dump'
         13        ISSET_ISEMPTY_CV                                 ~10     !1
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Class foo:
Function setbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s30ds
function name:  setBar
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function setbar

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s30ds
function name:  __get
number of ops:  4
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
   12     3*     > RETURN                                                   null

End of function __get

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.31 ms | 1396 KiB | 15 Q