3v4l.org

run code in 300+ PHP versions simultaneously
<?php $zip = new ZipArchive; $res = $zip->open('examle.zip', ZipArchive::CREATE); $zip->addFromString('example.txt', 'example text file'); $fp = $zip->getStream('example'); var_dump(stream_get_contents($fp));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JAA1p
function name:  (null)
number of ops:  24
compiled vars:  !0 = $zip, !1 = $res, !2 = $fp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'ZipArchive'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    3     3        INIT_METHOD_CALL                                         !0, 'open'
          4        SEND_VAL_EX                                              'examle.zip'
          5        FETCH_CLASS_CONSTANT                             ~6      'ZipArchive', 'CREATE'
          6        SEND_VAL_EX                                              ~6
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !1, $7
    4     9        INIT_METHOD_CALL                                         !0, 'addFromString'
         10        SEND_VAL_EX                                              'example.txt'
         11        SEND_VAL_EX                                              'example+text+file'
         12        DO_FCALL                                      0          
    5    13        INIT_METHOD_CALL                                         !0, 'getStream'
         14        SEND_VAL_EX                                              'example'
         15        DO_FCALL                                      0  $10     
         16        ASSIGN                                                   !2, $10
    6    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'stream_get_contents'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $12     
         21        SEND_VAR                                                 $12
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.64 ms | 1395 KiB | 17 Q