3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); // print() ignores strict_types... print(1 + 2) * 3; // outputs "9"; the parentheses cause 1+2 to be evaluated first, then 3*3 // the print statement sees the whole expression as one argument // As for the type mismatch? the strict_types ? ignored.. echo "\n"; if ( print("hello") && false ) { print "WTF: inside if"; } else { print "OK: inside else"; } echo "\n"; if ( 1 && false ) { print "WTF: inside if"; } else { print "OK: inside else"; } echo "\n"; print "hello " && print "world"; // outputs "world1"; ... WTF? echo "\n"; ob_start(); print "hello " && print "world"; $str = ob_get_clean(); assert(str_contains($str, 'hello'));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
Branch analysis from position: 11
filename:       /in/1YXYk
function name:  (null)
number of ops:  33
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     9
    9     1        ECHO                                                     '%0A'
   11     2        ECHO                                                     <false>
          3      > JMPZ                                                     1, ->6
   12     4    >   ECHO                                                     'WTF%3A+inside+if'
   11     5      > JMP                                                      ->7
   14     6    >   ECHO                                                     'OK%3A+inside+else'
   17     7    >   ECHO                                                     '%0A'
   19     8      > JMPZ                                                     <false>, ->11
   20     9    >   ECHO                                                     'WTF%3A+inside+if'
   19    10      > JMP                                                      ->12
   22    11    >   ECHO                                                     'OK%3A+inside+else'
   25    12    >   ECHO                                                     '%0A'
   27    13        ECHO                                                     'world'
         14        ECHO                                                     <true>
   30    15        ECHO                                                     '%0A'
   33    16        INIT_FCALL                                               'ob_start'
         17        DO_ICALL                                                 
   34    18        ECHO                                                     'world'
         19        ECHO                                                     <true>
   35    20        INIT_FCALL                                               'ob_get_clean'
         21        DO_ICALL                                         $2      
         22        ASSIGN                                                   !0, $2
   36    23        ASSERT_CHECK                                             
         24        INIT_FCALL                                               'assert'
         25        INIT_FCALL                                               'str_contains'
         26        SEND_VAR                                                 !0
         27        SEND_VAL                                                 'hello'
         28        DO_ICALL                                         $4      
         29        SEND_VAR                                                 $4
         30        SEND_VAL                                                 'assert%28str_contains%28%24str%2C+%27hello%27%29%29'
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.19 ms | 1436 KiB | 17 Q