3v4l.org

run code in 500+ PHP versions simultaneously
<?php $fp1 = fopen("/tmp/lock.test", 'w+'); $fp2 = fopen("/tmp/lock.test", 'w+'); flock($fp1, LOCK_EX); fclose($fp1); unlink("/tmp/lock.test"); $fp2IsLockedAndFileIsDeleted = flock($fp2, LOCK_EX) && !file_exists("/tmp/lock.test"); var_dump($fp2IsLockedAndFileIsDeleted);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 30
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/SilHY
function name:  (null)
number of ops:  35
compiled vars:  !0 = $fp1, !1 = $fp2, !2 = $fp2IsLockedAndFileIsDeleted
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'fopen'
          1        SEND_VAL                                                     '%2Ftmp%2Flock.test'
          2        SEND_VAL                                                     'w%2B'
          3        DO_ICALL                                             $3      
          4        ASSIGN                                                       !0, $3
    4     5        INIT_FCALL                                                   'fopen'
          6        SEND_VAL                                                     '%2Ftmp%2Flock.test'
          7        SEND_VAL                                                     'w%2B'
          8        DO_ICALL                                             $5      
          9        ASSIGN                                                       !1, $5
    6    10        INIT_FCALL                                                   'flock'
         11        SEND_VAR                                                     !0
         12        SEND_VAL                                                     2
         13        DO_ICALL                                                     
    7    14        INIT_FCALL                                                   'fclose'
         15        SEND_VAR                                                     !0
         16        DO_ICALL                                                     
    8    17        INIT_FCALL                                                   'unlink'
         18        SEND_VAL                                                     '%2Ftmp%2Flock.test'
         19        DO_ICALL                                                     
   10    20        INIT_FCALL                                                   'flock'
         21        SEND_VAR                                                     !1
         22        SEND_VAL                                                     2
         23        DO_ICALL                                             $10     
         24      > JMPZ_EX                                              ~11     $10, ->30
         25    >   INIT_FCALL                                                   'file_exists'
         26        SEND_VAL                                                     '%2Ftmp%2Flock.test'
         27        DO_ICALL                                             $12     
         28        BOOL_NOT                                             ~13     $12
         29        BOOL                                                 ~11     ~13
         30    >   ASSIGN                                                       !2, ~11
   12    31        INIT_FCALL                                                   'var_dump'
         32        SEND_VAR                                                     !2
         33        DO_ICALL                                                     
         34      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.96 ms | 2576 KiB | 19 Q