3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasOnlyUpdatedTimestamps(array $changedData): bool { if (count($changedData) === 0) { return false; } return count(array_key_diff($changedData,array_fill_keys(['last_authenticated', 'last_logged_in', 'updated'], null))) === 0; } var_dump(hasOnlyUpdatedTimestamps(["last_authenticated" => null])); var_dump(hasOnlyUpdatedTimestamps(["last_authenticated" => null, "last_logged_in" => null, "updated" => null])); var_dump(hasOnlyUpdatedTimestamps([])); var_dump(hasOnlyUpdatedTimestamps(["last_authenticateda" => null])); var_dump(hasOnlyUpdatedTimestamps(["last_authenticateda" => null, "ssss" => null]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cHtRO
function name:  (null)
number of ops:  31
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'hasonlyupdatedtimestamps'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   13     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'hasonlyupdatedtimestamps'
          8        SEND_VAL                                                 <array>
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
   14    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'hasonlyupdatedtimestamps'
         14        SEND_VAL                                                 <array>
         15        DO_FCALL                                      0  $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                                 
   15    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'hasonlyupdatedtimestamps'
         20        SEND_VAL                                                 <array>
         21        DO_FCALL                                      0  $6      
         22        SEND_VAR                                                 $6
         23        DO_ICALL                                                 
   16    24        INIT_FCALL                                               'var_dump'
         25        INIT_FCALL                                               'hasonlyupdatedtimestamps'
         26        SEND_VAL                                                 <array>
         27        DO_FCALL                                      0  $8      
         28        SEND_VAR                                                 $8
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Function hasonlyupdatedtimestamps:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cHtRO
function name:  hasOnlyUpdatedTimestamps
number of ops:  19
compiled vars:  !0 = $changedData
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        COUNT                                            ~1      !0
          2        IS_IDENTICAL                                             ~1, 0
          3      > JMPZ                                                     ~2, ->5
    6     4    > > RETURN                                                   <false>
    9     5    >   INIT_FCALL_BY_NAME                                       'array_key_diff'
          6        SEND_VAR_EX                                              !0
          7        INIT_FCALL                                               'array_fill_keys'
          8        SEND_VAL                                                 <array>
          9        SEND_VAL                                                 null
         10        DO_ICALL                                         $3      
         11        SEND_VAR_NO_REF_EX                                       $3
         12        DO_FCALL                                      0  $4      
         13        COUNT                                            ~5      $4
         14        IS_IDENTICAL                                     ~6      ~5, 0
         15        VERIFY_RETURN_TYPE                                       ~6
         16      > RETURN                                                   ~6
   10    17*       VERIFY_RETURN_TYPE                                       
         18*     > RETURN                                                   null

End of function hasonlyupdatedtimestamps

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.98 ms | 1403 KiB | 22 Q