3v4l.org

run code in 300+ PHP versions simultaneously
<?php class AnotherClass{ public $world = "world"; } $anotherClass = new AnotherClass(); class TestClass{ function __construct(){ ob_start(array($this,"callback")); } function callback($input){ global $anotherClass; return $input.$anotherClass->world; } } $tClass = new TestClass(); echo "hello";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cg6kV
function name:  (null)
number of ops:  8
compiled vars:  !0 = $anotherClass, !1 = $tClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $2      'AnotherClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   17     3        NEW                                              $5      'TestClass'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   19     6        ECHO                                                     'hello'
          7      > RETURN                                                   1

Class AnotherClass: [no user functions]
Class TestClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cg6kV
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'ob_start'
          1        FETCH_THIS                                       ~0      
          2        INIT_ARRAY                                       ~1      ~0
          3        ADD_ARRAY_ELEMENT                                ~1      'callback'
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                                 
   10     6      > RETURN                                                   null

End of function __construct

Function callback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cg6kV
function name:  callback
number of ops:  6
compiled vars:  !0 = $input, !1 = $anotherClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        BIND_GLOBAL                                              !1, 'anotherClass'
   14     2        FETCH_OBJ_R                                      ~2      !1, 'world'
          3        CONCAT                                           ~3      !0, ~2
          4      > RETURN                                                   ~3
   15     5*     > RETURN                                                   null

End of function callback

End of class TestClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.5 ms | 1395 KiB | 15 Q