3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($a,$b,$version="none"){ $output=array(); if($version=="none"){ $output["status"]="error"; $output["reason"]="Version missing"; print_r ($output); } echo PHP_EOL."test".PHP_EOL; } function testtwo($a,$b,$version="none"){ $output=array(); if(!is_int($version)){ $output["status"]="error"; $output["reason"]="Version missing"; print_r ($output); } echo PHP_EOL."testtwo".PHP_EOL; } $a = 0; $b = 0; $c = 0; test($a,$b); //testtwo($a,$b); test($a,$b,$c); //testtwo($a,$b,$c);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2v4t3
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   ASSIGN                                                   !0, 0
   24     1        ASSIGN                                                   !1, 0
   25     2        ASSIGN                                                   !2, 0
   27     3        INIT_FCALL                                               'test'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0          
   31     7        INIT_FCALL                                               'test'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !1
         10        SEND_VAR                                                 !2
         11        DO_FCALL                                      0          
   32    12      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/2v4t3
function name:  test
number of ops:  15
compiled vars:  !0 = $a, !1 = $b, !2 = $version, !3 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      'none'
    4     3        ASSIGN                                                   !3, <array>
    5     4        IS_EQUAL                                                 !2, 'none'
          5      > JMPZ                                                     ~5, ->13
    6     6    >   ASSIGN_DIM                                               !3, 'status'
          7        OP_DATA                                                  'error'
    7     8        ASSIGN_DIM                                               !3, 'reason'
          9        OP_DATA                                                  'Version+missing'
    8    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                                 
   10    13    >   ECHO                                                     '%0Atest%0A'
   11    14      > RETURN                                                   null

End of function test

Function testtwo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/2v4t3
function name:  testtwo
number of ops:  16
compiled vars:  !0 = $a, !1 = $b, !2 = $version, !3 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      'none'
   14     3        ASSIGN                                                   !3, <array>
   15     4        TYPE_CHECK                                   16  ~5      !2
          5        BOOL_NOT                                         ~6      ~5
          6      > JMPZ                                                     ~6, ->14
   16     7    >   ASSIGN_DIM                                               !3, 'status'
          8        OP_DATA                                                  'error'
   17     9        ASSIGN_DIM                                               !3, 'reason'
         10        OP_DATA                                                  'Version+missing'
   18    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                                 
   20    14    >   ECHO                                                     '%0Atesttwo%0A'
   21    15      > RETURN                                                   null

End of function testtwo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.19 ms | 1403 KiB | 17 Q