3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasOnlyUpdatedTimestamps(array $changedData): bool { $changedData = $user->changedAttributes(); 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/F2eF7
function name:  (null)
number of ops:  31
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     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                                                 
   15     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                                                 
   16    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                                                 
   17    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                                                 
   18    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 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F2eF7
function name:  hasOnlyUpdatedTimestamps
number of ops:  22
compiled vars:  !0 = $changedData, !1 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_METHOD_CALL                                         !1, 'changedAttributes'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !0, $2
    7     4        COUNT                                            ~4      !0
          5        IS_IDENTICAL                                             ~4, 0
          6      > JMPZ                                                     ~5, ->8
    8     7    > > RETURN                                                   <false>
   11     8    >   INIT_FCALL_BY_NAME                                       'array_key_diff'
          9        SEND_VAR_EX                                              !0
         10        INIT_FCALL                                               'array_fill_keys'
         11        SEND_VAL                                                 <array>
         12        SEND_VAL                                                 null
         13        DO_ICALL                                         $6      
         14        SEND_VAR_NO_REF_EX                                       $6
         15        DO_FCALL                                      0  $7      
         16        COUNT                                            ~8      $7
         17        IS_IDENTICAL                                     ~9      ~8, 0
         18        VERIFY_RETURN_TYPE                                       ~9
         19      > RETURN                                                   ~9
   12    20*       VERIFY_RETURN_TYPE                                       
         21*     > RETURN                                                   null

End of function hasonlyupdatedtimestamps

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.38 ms | 1403 KiB | 22 Q