3v4l.org

run code in 300+ PHP versions simultaneously
<?php function implode_wrapper($glue , $pieces) { return (version_compare(PHP_VERSION, '7.3.99', '>')) ? implode($glue, $pieces) : implode($pieces, $glue); } function test_func($a, $b, &$cRef) { $args = func_get_args(); echo __FUNCTION__."(".implode(",",$args) . ")\n"; $cRef+=$a; } $testdata = array( array(1,1), array(2,2), array(3,3), array(4,4) ); if(defined("E_STRICT")) ini_set("error_reporting", ini_get("error_reporting") | E_STRICT); $refTest = 10; foreach($testdata as $test) { $args = array(); foreach($test as $t) $args[] = &$t; $args[] = &$refTest; call_user_func_array("test_func", $args); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 10
Branch analysis from position: 2
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 27
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 27
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 19
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 10
filename:       /in/NJN2u
function name:  (null)
number of ops:  29
compiled vars:  !0 = $testdata, !1 = $refTest, !2 = $test, !3 = $args, !4 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   ASSIGN                                                   !0, <array>
   25     1      > JMPZ                                                     <true>, ->10
          2    >   INIT_FCALL                                               'ini_set'
          3        SEND_VAL                                                 'error_reporting'
          4        INIT_FCALL                                               'ini_get'
          5        SEND_VAL                                                 'error_reporting'
          6        DO_ICALL                                         $6      
          7        BW_OR                                            ~7      $6, 2048
          8        SEND_VAL                                                 ~7
          9        DO_ICALL                                                 
   27    10    >   ASSIGN                                                   !1, 10
   28    11      > FE_RESET_R                                       $10     !0, ->27
         12    > > FE_FETCH_R                                               $10, !2, ->27
   29    13    >   ASSIGN                                                   !3, <array>
   30    14      > FE_RESET_R                                       $12     !2, ->19
         15    > > FE_FETCH_R                                               $12, !4, ->19
         16    >   FETCH_DIM_W                                      $13     !3
         17        ASSIGN_REF                                               $13, !4
         18      > JMP                                                      ->15
         19    >   FE_FREE                                                  $12
   31    20        FETCH_DIM_W                                      $15     !3
         21        ASSIGN_REF                                               $15, !1
   32    22        INIT_FCALL                                               'test_func'
         23        SEND_ARRAY                                               !3
         24        CHECK_UNDEF_ARGS                                         
         25        DO_FCALL                                      0          
   28    26      > JMP                                                      ->12
         27    >   FE_FREE                                                  $10
   33    28      > RETURN                                                   1

Function implode_wrapper:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJN2u
function name:  implode_wrapper
number of ops:  21
compiled vars:  !0 = $glue, !1 = $pieces
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'version_compare'
          3        SEND_VAL                                                 '8.0.0'
          4        SEND_VAL                                                 '7.3.99'
          5        SEND_VAL                                                 '%3E'
          6        DO_ICALL                                         $2      
          7      > JMPZ                                                     $2, ->14
    5     8    >   INIT_FCALL                                               'implode'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $3      
         12        QM_ASSIGN                                        ~4      $3
         13      > JMP                                                      ->19
    6    14    >   INIT_FCALL                                               'implode'
         15        SEND_VAR                                                 !1
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $5      
         18        QM_ASSIGN                                        ~4      $5
         19    > > RETURN                                                   ~4
    7    20*     > RETURN                                                   null

End of function implode_wrapper

Function test_func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJN2u
function name:  test_func
number of ops:  14
compiled vars:  !0 = $a, !1 = $b, !2 = $cRef, !3 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   11     3        FUNC_GET_ARGS                                    ~4      
          4        ASSIGN                                                   !3, ~4
   12     5        INIT_FCALL                                               'implode'
          6        SEND_VAL                                                 '%2C'
          7        SEND_VAR                                                 !3
          8        DO_ICALL                                         $6      
          9        CONCAT                                           ~7      'test_func%28', $6
         10        CONCAT                                           ~8      ~7, '%29%0A'
         11        ECHO                                                     ~8
   13    12        ASSIGN_OP                                     1          !2, !0
   14    13      > RETURN                                                   null

End of function test_func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.76 ms | 1403 KiB | 22 Q