3v4l.org

run code in 300+ PHP versions simultaneously
<?php function true_or_false($bool) { return $bool ? 'true' : 'false'; } function do_test($expression) { echo "\t$expression : " . true_or_false(eval("return $expression;")) . "\n"; } function test($str) { echo "Testing $str\n"; do_test("$str == 0"); do_test("$str === 0"); } test('""'); test('null'); test('array()');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D4v8O
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'test'
          1        SEND_VAL                                                 '%22%22'
          2        DO_FCALL                                      0          
   17     3        INIT_FCALL                                               'test'
          4        SEND_VAL                                                 'null'
          5        DO_FCALL                                      0          
   18     6        INIT_FCALL                                               'test'
          7        SEND_VAL                                                 'array%28%29'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function true_or_false:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D4v8O
function name:  true_or_false
number of ops:  7
compiled vars:  !0 = $bool
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1      > JMPZ                                                     !0, ->4
          2    >   QM_ASSIGN                                        ~1      'true'
          3      > JMP                                                      ->5
          4    >   QM_ASSIGN                                        ~1      'false'
          5    > > RETURN                                                   ~1
    4     6*     > RETURN                                                   null

End of function true_or_false

Function do_test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D4v8O
function name:  do_test
number of ops:  15
compiled vars:  !0 = $expression
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ROPE_INIT                                     3  ~2      '%09'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '+%3A+'
          4        INIT_FCALL                                               'true_or_false'
          5        ROPE_INIT                                     3  ~5      'return+'
          6        ROPE_ADD                                      1  ~5      ~5, !0
          7        ROPE_END                                      2  ~4      ~5, '%3B'
          8        INCLUDE_OR_EVAL                                  $7      ~4, EVAL
          9        SEND_VAR                                                 $7
         10        DO_FCALL                                      0  $8      
         11        CONCAT                                           ~9      ~1, $8
         12        CONCAT                                           ~10     ~9, '%0A'
         13        ECHO                                                     ~10
    8    14      > RETURN                                                   null

End of function do_test

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D4v8O
function name:  test
number of ops:  16
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        ROPE_INIT                                     3  ~2      'Testing+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
   12     5        INIT_FCALL                                               'do_test'
          6        NOP                                                      
          7        FAST_CONCAT                                      ~4      !0, '+%3D%3D+0'
          8        SEND_VAL                                                 ~4
          9        DO_FCALL                                      0          
   13    10        INIT_FCALL                                               'do_test'
         11        NOP                                                      
         12        FAST_CONCAT                                      ~6      !0, '+%3D%3D%3D+0'
         13        SEND_VAL                                                 ~6
         14        DO_FCALL                                      0          
   14    15      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.61 ms | 1407 KiB | 19 Q