3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = ' 0 '; $x = str_replace(' ', '', $string) != ''; $y = trim($string) != ''; $z = trim($string) ? true : false; $z1 = empty(trim($string)); var_dump([$x, $y, $z, $z1]);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7LM6I
function name:  (null)
number of ops:  34
compiled vars:  !0 = $string, !1 = $x, !2 = $y, !3 = $z, !4 = $z1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '+0%0A'
    6     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '+'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        IS_NOT_EQUAL                                     ~7      $6, ''
          7        ASSIGN                                                   !1, ~7
    7     8        INIT_FCALL                                               'trim'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $9      
         11        IS_NOT_EQUAL                                     ~10     $9, ''
         12        ASSIGN                                                   !2, ~10
    8    13        INIT_FCALL                                               'trim'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $12     
         16      > JMPZ                                                     $12, ->19
         17    >   QM_ASSIGN                                        ~13     <true>
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~13     <false>
         20    >   ASSIGN                                                   !3, ~13
    9    21        INIT_FCALL                                               'trim'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $15     
         24        BOOL_NOT                                         ~16     $15
         25        ASSIGN                                                   !4, ~16
   11    26        INIT_FCALL                                               'var_dump'
         27        INIT_ARRAY                                       ~18     !1
         28        ADD_ARRAY_ELEMENT                                ~18     !2
         29        ADD_ARRAY_ELEMENT                                ~18     !3
         30        ADD_ARRAY_ELEMENT                                ~18     !4
         31        SEND_VAL                                                 ~18
         32        DO_ICALL                                                 
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.87 ms | 1008 KiB | 16 Q