3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lookup = [ '0' => [ 'column1' => 'value1', 'column2' => 'value2', ], '1' => [ 'column1' => 'value1', 'column2' => 'value2', ] ]; // First check the cache if the items exist there $cacheResult = getFromCache($lookup); // If cache result does not match lookup, check the database $databaseResult = getFromDatabase($someDifferenceWhichNeedsToCheckedFor); // if Database lookup gave back what's missed from the Cache addToCache($databaseResult); // and merge both results // If databaseResult does not give what was missing from cache check the external "provider" $providerResult = getFromProvider($someDifferenceWhichNeedsToCheckedFor); // if Provider lookup gave back what's missed from the Cache $queryResponse = addToDatabase($databaseResult); if($queryResponse) { addToCache($queryResponse); } //Return result
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/GG3Oq
function name:  (null)
number of ops:  25
compiled vars:  !0 = $lookup, !1 = $cacheResult, !2 = $databaseResult, !3 = $someDifferenceWhichNeedsToCheckedFor, !4 = $providerResult, !5 = $queryResponse
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   17     1        INIT_FCALL_BY_NAME                                       'getFromCache'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $7      
          4        ASSIGN                                                   !1, $7
   20     5        INIT_FCALL_BY_NAME                                       'getFromDatabase'
          6        SEND_VAR_EX                                              !3
          7        DO_FCALL                                      0  $9      
          8        ASSIGN                                                   !2, $9
   23     9        INIT_FCALL_BY_NAME                                       'addToCache'
         10        SEND_VAR_EX                                              !2
         11        DO_FCALL                                      0          
   27    12        INIT_FCALL_BY_NAME                                       'getFromProvider'
         13        SEND_VAR_EX                                              !3
         14        DO_FCALL                                      0  $12     
         15        ASSIGN                                                   !4, $12
   30    16        INIT_FCALL_BY_NAME                                       'addToDatabase'
         17        SEND_VAR_EX                                              !2
         18        DO_FCALL                                      0  $14     
         19        ASSIGN                                                   !5, $14
   32    20      > JMPZ                                                     !5, ->24
   33    21    >   INIT_FCALL_BY_NAME                                       'addToCache'
         22        SEND_VAR_EX                                              !5
         23        DO_FCALL                                      0          
   37    24    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.59 ms | 1394 KiB | 13 Q