3v4l.org

run code in 300+ PHP versions simultaneously
<?php $zipFilePath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'filename.zip'; $password = 'P455W0RD'; if (file_exists($zipFilePath)) { unlink($zipFilePath); } $zipArchive = new ZipArchive(); $zipArchive->open($zipFilePath, ZipArchive::CREATE); if ($zipArchive->setPassword($password)) { echo 'OK' . PHP_EOL; } foreach (range(1, 10) as $fileNumber) { $zipArchive->addFromString('file' . $fileNumber . '.txt', rand()); } $zipArchive->close();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 26
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 31, Position 2 = 41
Branch analysis from position: 31
2 jumps found. (Code = 78) Position 1 = 32, Position 2 = 41
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 26
Branch analysis from position: 13
filename:       /in/Hj0Ot
function name:  (null)
number of ops:  45
compiled vars:  !0 = $zipFilePath, !1 = $password, !2 = $zipArchive, !3 = $fileNumber
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'sys_get_temp_dir'
          1        DO_ICALL                                         $4      
          2        CONCAT                                           ~5      $4, '%2F'
          3        CONCAT                                           ~6      ~5, 'filename.zip'
          4        ASSIGN                                                   !0, ~6
    3     5        ASSIGN                                                   !1, 'P455W0RD'
    5     6        INIT_FCALL                                               'file_exists'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $9      
          9      > JMPZ                                                     $9, ->13
    6    10    >   INIT_FCALL                                               'unlink'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
    9    13    >   NEW                                              $11     'ZipArchive'
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !2, $11
   10    16        INIT_METHOD_CALL                                         !2, 'open'
         17        SEND_VAR_EX                                              !0
         18        FETCH_CLASS_CONSTANT                             ~14     'ZipArchive', 'CREATE'
         19        SEND_VAL_EX                                              ~14
         20        DO_FCALL                                      0          
   12    21        INIT_METHOD_CALL                                         !2, 'setPassword'
         22        SEND_VAR_EX                                              !1
         23        DO_FCALL                                      0  $16     
         24      > JMPZ                                                     $16, ->26
   13    25    >   ECHO                                                     'OK%0A'
   16    26    >   INIT_FCALL                                               'range'
         27        SEND_VAL                                                 1
         28        SEND_VAL                                                 10
         29        DO_ICALL                                         $17     
         30      > FE_RESET_R                                       $18     $17, ->41
         31    > > FE_FETCH_R                                               $18, !3, ->41
   17    32    >   INIT_METHOD_CALL                                         !2, 'addFromString'
         33        CONCAT                                           ~19     'file', !3
         34        CONCAT                                           ~20     ~19, '.txt'
         35        SEND_VAL_EX                                              ~20
         36        INIT_FCALL                                               'rand'
         37        DO_ICALL                                         $21     
         38        SEND_VAR_NO_REF_EX                                       $21
         39        DO_FCALL                                      0          
   16    40      > JMP                                                      ->31
         41    >   FE_FREE                                                  $18
   20    42        INIT_METHOD_CALL                                         !2, 'close'
         43        DO_FCALL                                      0          
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.51 ms | 1392 KiB | 23 Q