3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { function abc() { $callback = function(){ //Here is the syntax error return 'Hello world!<br>'; }; return $GLOBALS['otherClass']->birds($callback); } } class otherClass { function birds($callback) { return $callback(); } } $GLOBALS['otherClass'] = new otherClass(); $myClass = new myClass(); echo $myClass->abc(); echo $myClass->abc();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S1JjV
function name:  (null)
number of ops:  15
compiled vars:  !0 = $myClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $3      'otherClass'
          1        DO_FCALL                                      0          
          2        FETCH_W                      global              $1      'GLOBALS'
          3        ASSIGN_DIM                                               $1, 'otherClass'
          4        OP_DATA                                                  $3
   28     5        NEW                                              $5      'myClass'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $5
   30     8        INIT_METHOD_CALL                                         !0, 'abc'
          9        DO_FCALL                                      0  $8      
         10        ECHO                                                     $8
   31    11        INIT_METHOD_CALL                                         !0, 'abc'
         12        DO_FCALL                                      0  $9      
         13        ECHO                                                     $9
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FS1JjV%3A8%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S1JjV
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   'Hello+world%21%3Cbr%3E'
   10     1*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FS1JjV%3A8%240

Class myClass:
Function abc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S1JjV
function name:  abc
number of ops:  9
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FS1JjV%3A8%240'
          1        ASSIGN                                                   !0, ~1
   12     2        FETCH_R                      global              ~3      'GLOBALS'
          3        FETCH_DIM_R                                      ~4      ~3, 'otherClass'
          4        INIT_METHOD_CALL                                         ~4, 'birds'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $5      
          7      > RETURN                                                   $5
   14     8*     > RETURN                                                   null

End of function abc

End of class myClass.

Class otherClass:
Function birds:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S1JjV
function name:  birds
number of ops:  5
compiled vars:  !0 = $callback
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   22     1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $1      
          3      > RETURN                                                   $1
   23     4*     > RETURN                                                   null

End of function birds

End of class otherClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.78 ms | 1399 KiB | 13 Q