3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo() { if (false) { yield 'foo'; yield 'bar'; } } var_dump([] === new ArrayObject()); var_dump((bool) new ArrayObject()); var_dump(!new ArrayObject()); var_dump(!foo()); var_dump((bool) foo()); var_dump(count(new ArrayObject())); var_dump(count([])); var_dump(count(foo())); var_dump(count(iterator_to_array(foo()))); var_dump(foo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uscsN
function name:  (null)
number of ops:  61
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                                   'var_dump'
          1        NEW                                                  $0      'ArrayObject'
          2        DO_FCALL                                          0          
          3        IS_IDENTICAL                                         ~2      $0, <array>
          4        SEND_VAL                                                     ~2
          5        DO_ICALL                                                     
   12     6        INIT_FCALL                                                   'var_dump'
          7        NEW                                                  $4      'ArrayObject'
          8        DO_FCALL                                          0          
          9        BOOL                                                 ~6      $4
         10        SEND_VAL                                                     ~6
         11        DO_ICALL                                                     
   13    12        INIT_FCALL                                                   'var_dump'
         13        NEW                                                  $8      'ArrayObject'
         14        DO_FCALL                                          0          
         15        BOOL_NOT                                             ~10     $8
         16        SEND_VAL                                                     ~10
         17        DO_ICALL                                                     
   14    18        INIT_FCALL                                                   'var_dump'
         19        INIT_FCALL                                                   'foo'
         20        DO_FCALL                                          0  $12     
         21        BOOL_NOT                                             ~13     $12
         22        SEND_VAL                                                     ~13
         23        DO_ICALL                                                     
   15    24        INIT_FCALL                                                   'var_dump'
         25        INIT_FCALL                                                   'foo'
         26        DO_FCALL                                          0  $15     
         27        BOOL                                                 ~16     $15
         28        SEND_VAL                                                     ~16
         29        DO_ICALL                                                     
   16    30        INIT_FCALL                                                   'var_dump'
         31        NEW                                                  $18     'ArrayObject'
         32        DO_FCALL                                          0          
         33        COUNT                                                ~20     $18
         34        SEND_VAL                                                     ~20
         35        DO_ICALL                                                     
   17    36        INIT_FCALL                                                   'var_dump'
         37        COUNT                                                ~22     <array>
         38        SEND_VAL                                                     ~22
         39        DO_ICALL                                                     
   18    40        INIT_FCALL                                                   'var_dump'
         41        INIT_FCALL                                                   'foo'
         42        DO_FCALL                                          0  $24     
         43        COUNT                                                ~25     $24
         44        SEND_VAL                                                     ~25
         45        DO_ICALL                                                     
   19    46        INIT_FCALL                                                   'var_dump'
         47        INIT_FCALL                                                   'iterator_to_array'
         48        INIT_FCALL                                                   'foo'
         49        DO_FCALL                                          0  $27     
         50        SEND_VAR                                                     $27
         51        DO_ICALL                                             $28     
         52        COUNT                                                ~29     $28
         53        SEND_VAL                                                     ~29
         54        DO_ICALL                                                     
   21    55        INIT_FCALL                                                   'var_dump'
         56        INIT_FCALL                                                   'foo'
         57        DO_FCALL                                          0  $31     
         58        SEND_VAR                                                     $31
         59        DO_ICALL                                                     
         60      > RETURN                                                       1

Function foo:
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 = 161) Position 1 = -2
Branch analysis from position: 4
filename:       /in/uscsN
function name:  foo
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   GENERATOR_CREATE                                             
    5     1      > JMPZ                                                         <false>, ->4
    6     2    >   YIELD                                                        'foo'
    7     3        YIELD                                                        'bar'
    9     4    > > GENERATOR_RETURN                                             

End of function foo

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
133.3 ms | 486 KiB | 14 Q