3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myApp = []; $myApp["doTheThing"] = function () use (&$myApp) { echo 'Doing The Thing'; return $myApp; }; $myApp["doTheOtherThing"] = function () use (&$myApp) { echo "The Other Thing\n"; return $myApp; }; $myApp['doTheOtherThing']()['doTheThing'](); echo "\n------\n"; $myApp['doTheThing']()['doTheOtherThing']();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mmtav
function name:  (null)
number of ops:  23
compiled vars:  !0 = $myApp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fmmtav%3A5%240'
          2        BIND_LEXICAL                                             ~3, !0
          3        ASSIGN_DIM                                               !0, 'doTheThing'
    8     4        OP_DATA                                                  ~3
   10     5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fmmtav%3A10%241'
          6        BIND_LEXICAL                                             ~5, !0
          7        ASSIGN_DIM                                               !0, 'doTheOtherThing'
   13     8        OP_DATA                                                  ~5
   15     9        FETCH_DIM_R                                      ~6      !0, 'doTheOtherThing'
         10        INIT_DYNAMIC_CALL                                        ~6
         11        DO_FCALL                                      0  $7      
         12        FETCH_DIM_R                                      ~8      $7, 'doTheThing'
         13        INIT_DYNAMIC_CALL                                        ~8
         14        DO_FCALL                                      0          
   16    15        ECHO                                                     '%0A------%0A'
   17    16        FETCH_DIM_R                                      ~10     !0, 'doTheThing'
         17        INIT_DYNAMIC_CALL                                        ~10
         18        DO_FCALL                                      0  $11     
         19        FETCH_DIM_R                                      ~12     $11, 'doTheOtherThing'
         20        INIT_DYNAMIC_CALL                                        ~12
         21        DO_FCALL                                      0          
         22      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fmmtav%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mmtav
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $myApp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
    6     1        ECHO                                                     'Doing+The+Thing'
    7     2      > RETURN                                                   !0
    8     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fmmtav%3A5%240

Function %00%7Bclosure%7D%2Fin%2Fmmtav%3A10%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mmtav
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $myApp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   BIND_STATIC                                              !0
   11     1        ECHO                                                     'The+Other+Thing%0A'
   12     2      > RETURN                                                   !0
   13     3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fmmtav%3A10%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.8 ms | 1395 KiB | 13 Q