3v4l.org

run code in 300+ PHP versions simultaneously
<?php file_put_contents("test.txt", "Hello, world!"); $handle = fopen("test.txt", "r"); $contents = stream_get_contents($handle); echo "Contents A = {$contents}\n"; $contents = stream_get_contents($handle); echo "Contents B = {$contents}\n"; fclose($handle);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gHkPG
function name:  (null)
number of ops:  29
compiled vars:  !0 = $handle, !1 = $contents
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'file_put_contents'
          1        SEND_VAL                                                 'test.txt'
          2        SEND_VAL                                                 'Hello%2C+world%21'
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'fopen'
          5        SEND_VAL                                                 'test.txt'
          6        SEND_VAL                                                 'r'
          7        DO_ICALL                                         $3      
          8        ASSIGN                                                   !0, $3
    6     9        INIT_FCALL                                               'stream_get_contents'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $5      
         12        ASSIGN                                                   !1, $5
    7    13        ROPE_INIT                                     3  ~8      'Contents+A+%3D+'
         14        ROPE_ADD                                      1  ~8      ~8, !1
         15        ROPE_END                                      2  ~7      ~8, '%0A'
         16        ECHO                                                     ~7
    9    17        INIT_FCALL                                               'stream_get_contents'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $10     
         20        ASSIGN                                                   !1, $10
   10    21        ROPE_INIT                                     3  ~13     'Contents+B+%3D+'
         22        ROPE_ADD                                      1  ~13     ~13, !1
         23        ROPE_END                                      2  ~12     ~13, '%0A'
         24        ECHO                                                     ~12
   12    25        INIT_FCALL                                               'fclose'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.11 ms | 1399 KiB | 21 Q