3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myClass { } $obj = new myClass; $obj->color = function( $item ){ $arr = ["rose"=>"red", "violet"=>"blue", "grass"=>"green"]; return $arr[$item]; }; $flowers = [0=>"rose",1=>"violet"]; foreach ($flowers as $key => $flower){ echo "{$flower}s are ",($obj->color)($flower); echo ($key == 0)? ",\n" : " ...\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 25
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 25
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/Po0Fe
function name:  (null)
number of ops:  27
compiled vars:  !0 = $obj, !1 = $flowers, !2 = $flower, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   NEW                                              $4      'myClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    7     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FPo0Fe%3A7%240'
          4        ASSIGN_OBJ                                               !0, 'color'
   13     5        OP_DATA                                                  ~8
   16     6        ASSIGN                                                   !1, <array>
   18     7      > FE_RESET_R                                       $10     !1, ->25
          8    > > FE_FETCH_R                                       ~11     $10, !2, ->25
          9    >   ASSIGN                                                   !3, ~11
   19    10        NOP                                                      
         11        FAST_CONCAT                                      ~13     !2, 's+are+'
         12        ECHO                                                     ~13
         13        FETCH_OBJ_R                                      ~14     !0, 'color'
         14        INIT_DYNAMIC_CALL                                        ~14
         15        SEND_VAR_EX                                              !2
         16        DO_FCALL                                      0  $15     
         17        ECHO                                                     $15
   20    18        IS_EQUAL                                                 !3, 0
         19      > JMPZ                                                     ~16, ->22
         20    >   QM_ASSIGN                                        ~17     '%2C%0A'
         21      > JMP                                                      ->23
         22    >   QM_ASSIGN                                        ~17     '+...%0A'
         23    >   ECHO                                                     ~17
   18    24      > JMP                                                      ->8
         25    >   FE_FREE                                                  $10
   21    26      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FPo0Fe%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Po0Fe
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $item, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN                                                   !1, <array>
   12     2        FETCH_DIM_R                                      ~3      !1, !0
          3      > RETURN                                                   ~3
   13     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FPo0Fe%3A7%240

Class myClass: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.41 ms | 1399 KiB | 13 Q