3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $stage; public function __construct($stage) { $this->stage = $stage; } public function __toString() { echo $this->stage.''; } } $array['test'] = function ($i) {return new Test($i);}; echo $array['test']('test');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6KZvk
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'test'
   17     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F6KZvk%3A17%241'
          2        ASSIGN_DIM                                               !0, 'test'
          3        OP_DATA                                                  ~2
   19     4        FETCH_DIM_R                                      ~3      !0, 'test'
          5        INIT_DYNAMIC_CALL                                        ~3
          6        SEND_VAL_EX                                              'test'
          7        DO_FCALL                                      0  $4      
          8        ECHO                                                     $4
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F6KZvk%3A17%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6KZvk
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        NEW                                              $1      'Test'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $1
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F6KZvk%3A17%241

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

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6KZvk
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~0      'stage'
          1        CONCAT                                           ~1      ~0, ''
          2        ECHO                                                     ~1
   14     3        VERIFY_RETURN_TYPE                                       
          4      > RETURN                                                   null

End of function __tostring

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.27 ms | 1386 KiB | 13 Q