3v4l.org

run code in 500+ PHP versions simultaneously
<?php $int = 42; $string = ' foo'; $trimmed = trim($string); assert(!is_numeric($string)); assert(!is_numeric($trimmed)); var_dump((string)$int <=> $string); var_dump((string)$int <=> $trimmed);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RIUI5
function name:  (null)
number of ops:  29
compiled vars:  !0 = $int, !1 = $string, !2 = $trimmed
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 42
    4     1        ASSIGN                                                       !1, '+foo'
    6     2        FRAMELESS_ICALL_1                trim                ~5      !1
          3        ASSIGN                                                       !2, ~5
    8     4        ASSERT_CHECK                                                 
          5        INIT_FCALL                                                   'assert'
          6        FRAMELESS_ICALL_1                is_numeric          ~7      !1
          7        BOOL_NOT                                             ~8      ~7
          8        SEND_VAL                                                     ~8
          9        SEND_VAL                                                     'assert%28%21is_numeric%28%24string%29%29'
         10        DO_ICALL                                                     
    9    11        ASSERT_CHECK                                                 
         12        INIT_FCALL                                                   'assert'
         13        FRAMELESS_ICALL_1                is_numeric          ~10     !2
         14        BOOL_NOT                                             ~11     ~10
         15        SEND_VAL                                                     ~11
         16        SEND_VAL                                                     'assert%28%21is_numeric%28%24trimmed%29%29'
         17        DO_ICALL                                                     
   11    18        INIT_FCALL                                                   'var_dump'
         19        CAST                                              6  ~13     !0
         20        SPACESHIP                                            ~14     ~13, !1
         21        SEND_VAL                                                     ~14
         22        DO_ICALL                                                     
   12    23        INIT_FCALL                                                   'var_dump'
         24        CAST                                              6  ~16     !0
         25        SPACESHIP                                            ~17     ~16, !2
         26        SEND_VAL                                                     ~17
         27        DO_ICALL                                                     
         28      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.96 ms | 2153 KiB | 19 Q