3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { static function cast(&$val, $key) { if (is_numeric($val)) { //return $val + 0; $val += 0; } //return 0; //return $val; } static function run() { $arr = ['stri33ng123', 84, 76.7, '45.6', '67.5e45', '56,9']; var_dump($arr); array_walk($arr , 'cast'); var_dump($arr); } } A::run();
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/SYutg
function name:  (null)
number of ops:  4
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NOP                                                      
  29     1        INIT_STATIC_METHOD_CALL                                  'A', 'run'
         2        DO_FCALL                                      0          
         3      > RETURN                                                   1

Class A:
Function cast:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
Jump found. Position 1 = -2
Branch analysis from position: 7
filename:       /in/SYutg
function name:  cast
number of ops:  8
compiled vars:  !0 = $val, !1 = $key
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   RECV                                             !0      
         1        RECV                                             !1      
   4     2        INIT_FCALL                                               'is_numeric'
         3        SEND_VAR                                                 !0
         4        DO_ICALL                                         $2      
         5      > JMPZ                                                     $2, ->7
   6     6    >   ASSIGN_ADD                                    0          !0, 0
  11     7    > > RETURN                                                   null

End of function cast

Function run:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/SYutg
function name:  run
number of ops:  12
compiled vars:  !0 = $arr
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  15     0  E >   ASSIGN                                                   !0, <array>
  16     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                                                 'cast'
         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 7.2.0