3v4l.org

run code in 300+ PHP versions simultaneously
<?php function experiment1($first, $two='') { echo $first . ' - ' . $two; } experiment1(1); $two = 2; function experiment2($first, $two='') { global $two; echo $first . ' - ' . $two; } experiment2(1); experiment2(1,3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TRBM0
function name:  (null)
number of ops:  12
compiled vars:  !0 = $two
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'experiment1'
          1        SEND_VAL                                                 1
          2        DO_FCALL                                      0          
    8     3        ASSIGN                                                   !0, 2
   15     4        INIT_FCALL                                               'experiment2'
          5        SEND_VAL                                                 1
          6        DO_FCALL                                      0          
   17     7        INIT_FCALL                                               'experiment2'
          8        SEND_VAL                                                 1
          9        SEND_VAL                                                 3
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Function experiment1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TRBM0
function name:  experiment1
number of ops:  6
compiled vars:  !0 = $first, !1 = $two
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
    3     2        CONCAT                                           ~2      !0, '++-++'
          3        CONCAT                                           ~3      ~2, !1
          4        ECHO                                                     ~3
    4     5      > RETURN                                                   null

End of function experiment1

Function experiment2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TRBM0
function name:  experiment2
number of ops:  7
compiled vars:  !0 = $first, !1 = $two
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
   11     2        BIND_GLOBAL                                              !1, 'two'
   12     3        CONCAT                                           ~2      !0, '++-++'
          4        CONCAT                                           ~3      ~2, !1
          5        ECHO                                                     ~3
   13     6      > RETURN                                                   null

End of function experiment2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.2 ms | 1399 KiB | 16 Q