3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cast($val, $c, $e) { echo $e; if (is_numeric($val)) { return $val + 0; } //return 0; return $val; } $arr = ['stri33ng123', 84, 76.7, '45.6', '67.5e45', '56,9']; array_walk($arr , 'cast');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pDHLv
function name:  (null)
number of ops:  6
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   17     1        INIT_FCALL                                               'array_walk'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'cast'
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Function cast:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pDHLv
function name:  cast
number of ops:  12
compiled vars:  !0 = $val, !1 = $c, !2 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    5     3        ECHO                                                     !2
    6     4        INIT_FCALL                                               'is_numeric'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7      > JMPZ                                                     $3, ->10
    7     8    >   ADD                                              ~4      !0, 0
          9      > RETURN                                                   ~4
   11    10    > > RETURN                                                   !0
   12    11*     > RETURN                                                   null

End of function cast

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.79 ms | 1395 KiB | 17 Q