3v4l.org

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

Function isstringornumeric:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YFEjO
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

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.95 ms | 1396 KiB | 19 Q