3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { static function cast(&$val, $key, $allow_zero_first_character = false) { if (is_numeric($val)) { if($allow_zero_first_character || (!$allow_zero_first_character && $val[0] != '0')) { $val += 0; } } } static function run() { $arr = ['stri33ng123', 84, 76.7, '45.6', '67.5e45', '56,9']; var_dump($arr); //array_walk($arr , ['self', 'cast']); array_walk($arr , 'self::cast'); var_dump($arr); } } A::run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NlMWJ
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'run'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Class A:
Function cast:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
2 jumps found. (Code = 47) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
Branch analysis from position: 13
Branch analysis from position: 14
Branch analysis from position: 16
filename:       /in/NlMWJ
function name:  cast
number of ops:  17
compiled vars:  !0 = $val, !1 = $key, !2 = $allow_zero_first_character
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      <false>
    4     3        INIT_FCALL                                               'is_numeric'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6      > JMPZ                                                     $3, ->16
    5     7    > > JMPNZ_EX                                         ~4      !2, ->14
          8    >   BOOL_NOT                                         ~5      !2
          9      > JMPZ_EX                                          ~5      ~5, ->13
         10    >   FETCH_DIM_R                                      ~6      !0, 0
         11        IS_NOT_EQUAL                                     ~7      ~6, '0'
         12        BOOL                                             ~5      ~7
         13    >   BOOL                                             ~4      ~5
         14    > > JMPZ                                                     ~4, ->16
    6    15    >   ASSIGN_OP                                     1          !0, 0
   10    16    > > RETURN                                                   null

End of function cast

Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NlMWJ
function name:  run
number of ops:  12
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   15     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   18     4        INIT_FCALL                                               'array_walk'
          5        SEND_REF                                                 !0
          6        SEND_VAL                                                 'self%3A%3Acast'
          7        DO_ICALL                                                 
   19     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   20    11      > RETURN                                                   null

End of function run

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.86 ms | 1400 KiB | 19 Q