3v4l.org

run code in 500+ PHP versions simultaneously
<?php function f($a,$b){return(int)$a==(int)$b;} $testCases = [ [["0001", "1 "], true], [["1450", "1450 "], true], [["0010001 ", " 10001 "], true], [["0010000", " 10 "], false], [["101023", "101024"], false], ]; foreach ($testCases as $testCase) { list($values, $expected) = $testCase; assert($expected === f(...$values)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 20
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/a9EUL
function name:  (null)
number of ops:  22
compiled vars:  !0 = $testCases, !1 = $testCase, !2 = $values, !3 = $expected
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                       !0, <array>
   12     1      > FE_RESET_R                                           $5      !0, ->20
          2    > > FE_FETCH_R                                                   $5, !1, ->20
   13     3    >   QM_ASSIGN                                            ~6      !1
          4        FETCH_LIST_R                                         $7      ~6, 0
          5        ASSIGN                                                       !2, $7
          6        FETCH_LIST_R                                         $9      ~6, 1
          7        ASSIGN                                                       !3, $9
          8        FREE                                                         ~6
   14     9        ASSERT_CHECK                                                 
         10        INIT_FCALL                                                   'assert'
         11        INIT_FCALL                                                   'f'
         12        SEND_UNPACK                                                  !2
         13        CHECK_UNDEF_ARGS                                             
         14        DO_FCALL                                          0  $11     
         15        IS_IDENTICAL                                         ~12     !3, $11
         16        SEND_VAL                                                     ~12
         17        SEND_VAL                                                     'assert%28%24expected+%3D%3D%3D+f%28...%24values%29%29'
         18        DO_ICALL                                                     
   12    19      > JMP                                                          ->2
         20    >   FE_FREE                                                      $5
   15    21      > RETURN                                                       1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/a9EUL
function name:  f
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        CAST                                              4  ~2      !0
          3        CAST                                              4  ~3      !1
          4        IS_EQUAL                                             ~4      ~2, ~3
          5      > RETURN                                                       ~4
          6*     > RETURN                                                       null

End of function f

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
128.24 ms | 481 KiB | 9 Q