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(["last_authenticated" => null]); var_dump(["last_authenticated" => null, "last_logged_in" => null, "updated" => null]); var_dump([]); var_dump(["last_authenticateda" => null]); var_dump(["last_authenticateda" => null, "ssss" => null]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PSF1D
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 <array>
          2        DO_ICALL                                                 
   15     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAL                                                 <array>
          5        DO_ICALL                                                 
   16     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAL                                                 <array>
          8        DO_ICALL                                                 
   17     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAL                                                 <array>
         11        DO_ICALL                                                 
   18    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAL                                                 <array>
         14        DO_ICALL                                                 
         15      > 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/PSF1D
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:
149.76 ms | 1400 KiB | 17 Q