3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); // so only PHP 7 will show up class FooBar { private $x; public function __construct() { var_dump($this); echo "Let's remove a property!", PHP_EOL; var_dump($this); // It's gone! 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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lH3JO
function name:  (null)
number of ops:  4
compiled vars:  !0 = $foobar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'Foobar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class FooBar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lH3JO
function name:  __construct
number of ops:  21
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        INIT_FCALL                                               'var_dump'
          7        FETCH_THIS                                       ~2      
          8        SEND_VAL                                                 ~2
          9        DO_ICALL                                                 
   15    10        ECHO                                                     'Let%27s+add+a+property%21'
         11        ECHO                                                     '%0A'
   17    12        ASSIGN_OBJ                                               'x'
         13        OP_DATA                                                  2
   18    14        INIT_FCALL                                               'var_dump'
         15        FETCH_THIS                                       ~5      
         16        SEND_VAL                                                 ~5
         17        DO_ICALL                                                 
   20    18        ECHO                                                     'Where+did+the+private+come+from%3F'
         19        ECHO                                                     '%0A'
   21    20      > RETURN                                                   null

End of function __construct

End of class FooBar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.35 ms | 1395 KiB | 15 Q