3v4l.org

run code in 300+ PHP versions simultaneously
<?php function square(&$n) { // Check if the item is a number if(is_numeric($n)) $n = ($n * $n); // Yes, square it else $n = "Not a number"; // No, replace with this } // Initialize the array $array = array(0, 48, 22, 90, 44, 9, 222, 'Iamzheasshole', 101); // Walk through the array, called the square function for every item array_walk($array, 'square'); // Output the array print_r($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FjDJ7
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   16     1        INIT_FCALL                                               'array_walk'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'square'
          4        DO_ICALL                                                 
   19     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function square:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FjDJ7
function name:  square
number of ops:  10
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'is_numeric'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > JMPZ                                                     $1, ->8
    6     5    >   MUL                                              ~2      !0, !0
          6        ASSIGN                                                   !0, ~2
          7      > JMP                                                      ->9
    9     8    >   ASSIGN                                                   !0, 'Not+a+number'
   10     9    > > RETURN                                                   null

End of function square

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.41 ms | 1395 KiB | 19 Q