3v4l.org

run code in 300+ PHP versions simultaneously
<?php phpversion() >= "7.0.0" or die(); class FooBar { private $x; public function __construct() { var_dump($this); echo "Let's remove a property!", PHP_EOL; unset($this->x); var_dump($this); var_dump(property_exists($this, 'x')); echo "Let's add a property!", PHP_EOL; $this->x = 2; var_dump($this); echo "Where did the private come from?", PHP_EOL; } } $foobar = new Foobar;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Phehi
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foobar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'phpversion'
          1        DO_ICALL                                         $1      
          2        IS_SMALLER_OR_EQUAL                              ~2      '7.0.0', $1
          3      > JMPNZ_EX                                         ~2      ~2, ->6
          4    > > EXIT                                                     
          5*       BOOL                                             ~2      <true>
   26     6    >   NEW                                              $3      'Foobar'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $3
          9      > RETURN                                                   1

Class FooBar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Phehi
function name:  __construct
number of ops:  30
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   11     4        ECHO                                                     'Let%27s+remove+a+property%21'
          5        ECHO                                                     '%0A'
   13     6        UNSET_OBJ                                                'x'
   14     7        INIT_FCALL                                               'var_dump'
          8        FETCH_THIS                                       ~2      
          9        SEND_VAL                                                 ~2
         10        DO_ICALL                                                 
   15    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'property_exists'
         13        FETCH_THIS                                       ~4      
         14        SEND_VAL                                                 ~4
         15        SEND_VAL                                                 'x'
         16        DO_ICALL                                         $5      
         17        SEND_VAR                                                 $5
         18        DO_ICALL                                                 
   17    19        ECHO                                                     'Let%27s+add+a+property%21'
         20        ECHO                                                     '%0A'
   19    21        ASSIGN_OBJ                                               'x'
         22        OP_DATA                                                  2
   20    23        INIT_FCALL                                               'var_dump'
         24        FETCH_THIS                                       ~8      
         25        SEND_VAL                                                 ~8
         26        DO_ICALL                                                 
   22    27        ECHO                                                     'Where+did+the+private+come+from%3F'
         28        ECHO                                                     '%0A'
   23    29      > RETURN                                                   null

End of function __construct

End of class FooBar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.01 ms | 1400 KiB | 19 Q