3v4l.org

run code in 300+ PHP versions simultaneously
<?php //unset($a); $b = ['translator' => 5]; function testA() { // global $a; return $a['translator']->transChoice($args[0]); } function testB() { global $b; return $b['translator']->transChoice($args[0]); } testA();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FPfUC
function name:  (null)
number of ops:  4
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'testa'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function testa:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FPfUC
function name:  testA
number of ops:  8
compiled vars:  !0 = $a, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_DIM_R                                      ~2      !0, 'translator'
          1        INIT_METHOD_CALL                                         ~2, 'transChoice'
          2        CHECK_FUNC_ARG                                           
          3        FETCH_DIM_FUNC_ARG                               $3      !1, 0
          4        SEND_FUNC_ARG                                            $3
          5        DO_FCALL                                      0  $4      
          6      > RETURN                                                   $4
    7     7*     > RETURN                                                   null

End of function testa

Function testb:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FPfUC
function name:  testB
number of ops:  9
compiled vars:  !0 = $b, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   BIND_GLOBAL                                              !0, 'b'
   10     1        FETCH_DIM_R                                      ~2      !0, 'translator'
          2        INIT_METHOD_CALL                                         ~2, 'transChoice'
          3        CHECK_FUNC_ARG                                           
          4        FETCH_DIM_FUNC_ARG                               $3      !1, 0
          5        SEND_FUNC_ARG                                            $3
          6        DO_FCALL                                      0  $4      
          7      > RETURN                                                   $4
   11     8*     > RETURN                                                   null

End of function testb

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.22 ms | 1398 KiB | 14 Q