3v4l.org

run code in 300+ PHP versions simultaneously
<?php $GLOBALS['_start_time'] = microtime(true); echo "*** Testing fgetc() : usage variations ***\n"; echo "-- Testing fgetc() with files opened with different read modes --\n"; $file_modes = array( "a+", "a+b", "a+t","x+", "x+b", "x+t","w+", "w+b", "w+t" ); $filename = __DIR__."non-exist.tmp"; function &test() : string {} function &gen() { yield $str[0]; } try { $str = "foo"; } catch (Error $e) { } var_dump($filename); var_dump($str); $x1=$filename; $x2=$str; var_dump(strcmp($x1,$x2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 11
Branch analysis from position: 11
2 jumps found. (Code = 107) Position 1 = 12, Position 2 = -2
Branch analysis from position: 12
filename:       /in/4dV2h
function name:  (null)
number of ops:  28
compiled vars:  !0 = $file_modes, !1 = $filename, !2 = $str, !3 = $e, !4 = $x1, !5 = $x2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $7      
          3        FETCH_W                      global              $6      '_start_time'
          4        ASSIGN                                                   $6, $7
    3     5        ECHO                                                     '%2A%2A%2A+Testing+fgetc%28%29+%3A+usage+variations+%2A%2A%2A%0A'
    4     6        ECHO                                                     '--+Testing+fgetc%28%29+with+files+opened+with+different+read+modes+--%0A'
    5     7        ASSIGN                                                   !0, <array>
    6     8        ASSIGN                                                   !1, '%2Finnon-exist.tmp'
   10     9        ASSIGN                                                   !2, 'foo'
         10      > JMP                                                      ->12
   11    11  E > > CATCH                                       last         'Error'
   13    12    >   INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   14    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                                 
   15    18        ASSIGN                                                   !4, !1
   16    19        ASSIGN                                                   !5, !2
   17    20        INIT_FCALL                                               'var_dump'
         21        INIT_FCALL                                               'strcmp'
         22        SEND_VAR                                                 !4
         23        SEND_VAR                                                 !5
         24        DO_ICALL                                         $16     
         25        SEND_VAR                                                 $16
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/4dV2h
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   VERIFY_RETURN_TYPE                                       
          1      > RETURN_BY_REF                                            null

End of function test

Function gen:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 161) Position 1 = -2
filename:       /in/4dV2h
function name:  gen
number of ops:  4
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   GENERATOR_CREATE                                         
          1        FETCH_DIM_W                                      $1      !0, 0
          2        YIELD                                                    $1
          3      > GENERATOR_RETURN                                         

End of function gen

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.65 ms | 1009 KiB | 16 Q