3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ABC{ private $name; function __construct($name=NULL){ $this->name = $name ?: 'abc'; } function bar(){ return $this->name; } } $template = new ABC('test'); echo $template->bar()."\n"; $foo = call_user_func(array(clone $template, 'bar')); echo $foo;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9cLEL
function name:  (null)
number of ops:  16
compiled vars:  !0 = $template, !1 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'ABC'
          1        SEND_VAL_EX                                              'test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   15     4        INIT_METHOD_CALL                                         !0, 'bar'
          5        DO_FCALL                                      0  $5      
          6        CONCAT                                           ~6      $5, '%0A'
          7        ECHO                                                     ~6
   17     8        CLONE                                            ~7      !0
          9        INIT_ARRAY                                       ~8      ~7
         10        ADD_ARRAY_ELEMENT                                ~8      'bar'
         11        INIT_USER_CALL                                0          'call_user_func', ~8
         12        DO_FCALL                                      0  $9      
         13        ASSIGN                                                   !1, $9
   19    14        ECHO                                                     !1
         15      > RETURN                                                   1

Class ABC:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9cLEL
function name:  __construct
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      null
    6     1        JMP_SET                                          ~2      !0, ->3
          2        QM_ASSIGN                                        ~2      'abc'
          3        ASSIGN_OBJ                                               'name'
          4        OP_DATA                                                  ~2
    7     5      > RETURN                                                   null

End of function __construct

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9cLEL
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1      > RETURN                                                   ~0
   11     2*     > RETURN                                                   null

End of function bar

End of class ABC.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.24 ms | 1395 KiB | 13 Q