3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myVariable1 = '2345'; $myVariable2 = 4433; $myVariable3 = 'test'; $myVariable4 = '1345.33'; function makeInteger($val){ return is_numeric($val) ? (int)$val : null; } for($i=1;$i<=4;$i++){ echo makeInteger(${"myVariable".$i}).PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
Branch analysis from position: 6
filename:       /in/lA5Se
function name:  (null)
number of ops:  17
compiled vars:  !0 = $myVariable1, !1 = $myVariable2, !2 = $myVariable3, !3 = $myVariable4, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2345'
    4     1        ASSIGN                                                   !1, 4433
    5     2        ASSIGN                                                   !2, 'test'
    6     3        ASSIGN                                                   !3, '1345.33'
   10     4        ASSIGN                                                   !4, 1
          5      > JMP                                                      ->14
   11     6    >   INIT_FCALL                                               'makeinteger'
          7        CONCAT                                           ~10     'myVariable', !4
          8        FETCH_R                      local               ~11     ~10
          9        SEND_VAL                                                 ~11
         10        DO_FCALL                                      0  $12     
         11        CONCAT                                           ~13     $12, '%0A'
         12        ECHO                                                     ~13
   10    13        PRE_INC                                                  !4
         14    >   IS_SMALLER_OR_EQUAL                                      !4, 4
         15      > JMPNZ                                                    ~15, ->6
   12    16    > > RETURN                                                   1

Function makeinteger:
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/lA5Se
function name:  makeInteger
number of ops:  11
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'is_numeric'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > JMPZ                                                     $1, ->8
          5    >   CAST                                          4  ~2      !0
          6        QM_ASSIGN                                        ~3      ~2
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~3      null
          9    > > RETURN                                                   ~3
    9    10*     > RETURN                                                   null

End of function makeinteger

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.22 ms | 1003 KiB | 15 Q