3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isStringOrNumeric($in) { return basename($in); } function test($a, $v) { var_dump($a); var_dump($v); } $a = array( 'index.php', '../../../index.php', 'valami.txt'); array_reduce($a, 'test'); /*$b = array_filter($a, 'isStringOrNumeric'); var_dump($a); var_dump($b);*/ if($b === $a) echo('Success!'); else echo('Fail!');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L2h32
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'array_reduce'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'test'
          4        DO_ICALL                                                 
   17     5        IS_IDENTICAL                                             !1, !0
          6      > JMPZ                                                     ~4, ->9
   18     7    >   ECHO                                                     'Success%21'
          8      > JMP                                                      ->10
   20     9    >   ECHO                                                     'Fail%21'
         10    > > RETURN                                                   1

Function isstringornumeric:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L2h32
function name:  isStringOrNumeric
number of ops:  6
compiled vars:  !0 = $in
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'basename'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
    4     5*     > RETURN                                                   null

End of function isstringornumeric

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L2h32
function name:  test
number of ops:  9
compiled vars:  !0 = $a, !1 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    8     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    9     8      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.26 ms | 1396 KiB | 19 Q