3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { var $my_public = array(); //forward php4 to constructor function foo() { $this->my_public[] = 'php4 constructor'; return $this->__construct(); } //constructor php5 function __construct() { $this->my_public[] = 'php4 constructor'; register_shutdown_function(array(&$this, "__destruct")); } function dump() { print_r($this->my_public); } } $test = new foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XOEOu
function name:  (null)
number of ops:  4
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class foo:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XOEOu
function name:  foo
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_W                                      $0      'my_public'
          1        ASSIGN_DIM                                               $0
          2        OP_DATA                                                  'php4+constructor'
   11     3        INIT_METHOD_CALL                                         '__construct'
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
   12     6*     > RETURN                                                   null

End of function foo

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XOEOu
function name:  __construct
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_W                                      $0      'my_public'
          1        ASSIGN_DIM                                               $0
          2        OP_DATA                                                  'php4+constructor'
   19     3        INIT_FCALL                                               'register_shutdown_function'
          4        FETCH_THIS                                       $2      
          5        INIT_ARRAY                                       ~3      $2
          6        ADD_ARRAY_ELEMENT                                ~3      '__destruct'
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
   20     9      > RETURN                                                   null

End of function __construct

Function dump:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XOEOu
function name:  dump
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'print_r'
          1        FETCH_OBJ_R                                      ~0      'my_public'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   23     4      > RETURN                                                   null

End of function dump

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.8 ms | 1396 KiB | 17 Q