3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $private = ""; public function add($string) { $this->private[] = $string; } public function evaluate(Test $container) { return $container->private; } } $test = new Test(); $test->add("zero"); $test->add("one"); $test->add("two"); $result = new Test(); print_r($test->private);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F5n8h
function name:  (null)
number of ops:  20
compiled vars:  !0 = $test, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   17     3        INIT_METHOD_CALL                                         !0, 'add'
          4        SEND_VAL_EX                                              'zero'
          5        DO_FCALL                                      0          
   18     6        INIT_METHOD_CALL                                         !0, 'add'
          7        SEND_VAL_EX                                              'one'
          8        DO_FCALL                                      0          
   19     9        INIT_METHOD_CALL                                         !0, 'add'
         10        SEND_VAL_EX                                              'two'
         11        DO_FCALL                                      0          
   21    12        NEW                                              $8      'Test'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !1, $8
   22    15        INIT_FCALL                                               'print_r'
         16        FETCH_OBJ_R                                      ~11     !0, 'private'
         17        SEND_VAL                                                 ~11
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class Test:
Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F5n8h
function name:  add
number of ops:  5
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        FETCH_OBJ_W                                      $1      'private'
          2        ASSIGN_DIM                                               $1
          3        OP_DATA                                                  !0
    9     4      > RETURN                                                   null

End of function add

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

End of function evaluate

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.75 ms | 1396 KiB | 15 Q