3v4l.org

run code in 300+ PHP versions simultaneously
<?php # Will query and assign the permissions as directed by the list worker require_once 'aws.phar'; $args = (array) getPayload(); echo "Assigning permissions\n"; require 's3_connect.php'; $all_users = array('URI' => 'http://acs.amazonaws.com/groups/global/AllUsers'); foreach( $args['keys'] as $key ) { $grants = $s3->getObjectAcl(array( 'Bucket' => $args['bucket'], 'Key' => $key, )); if (strpos($key, '.d201402') !== FALSE){ $stringToReplace = $key; $removeTimestamp = strlen($stringToReplace); $removeTimestamp = floor($removeTimestamp - 21); $keytemp = substr_replace($stringToReplace, "jpg", $removeTimestamp); } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 39
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 39
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 38
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 38
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/Fv5jD
function name:  (null)
number of ops:  41
compiled vars:  !0 = $args, !1 = $all_users, !2 = $key, !3 = $grants, !4 = $s3, !5 = $stringToReplace, !6 = $removeTimestamp, !7 = $keytemp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INCLUDE_OR_EVAL                                          'aws.phar', REQUIRE_ONCE
    6     1        INIT_FCALL_BY_NAME                                       'getPayload'
          2        DO_FCALL                                      0  $9      
          3        CAST                                          7  ~10     $9
          4        ASSIGN                                                   !0, ~10
    7     5        ECHO                                                     'Assigning+permissions%0A'
    9     6        INCLUDE_OR_EVAL                                          's3_connect.php', REQUIRE
   10     7        ASSIGN                                                   !1, <array>
   12     8        FETCH_DIM_R                                      ~14     !0, 'keys'
          9      > FE_RESET_R                                       $15     ~14, ->39
         10    > > FE_FETCH_R                                               $15, !2, ->39
   13    11    >   INIT_METHOD_CALL                                         !4, 'getObjectAcl'
   14    12        FETCH_DIM_R                                      ~16     !0, 'bucket'
         13        INIT_ARRAY                                       ~17     ~16, 'Bucket'
   15    14        ADD_ARRAY_ELEMENT                                ~17     !2, 'Key'
         15        SEND_VAL_EX                                              ~17
         16        DO_FCALL                                      0  $18     
   13    17        ASSIGN                                                   !3, $18
   18    18        INIT_FCALL                                               'strpos'
         19        SEND_VAR                                                 !2
         20        SEND_VAL                                                 '.d201402'
         21        DO_ICALL                                         $20     
         22        TYPE_CHECK                                  1018          $20
         23      > JMPZ                                                     ~21, ->38
   19    24    >   ASSIGN                                                   !5, !2
   20    25        STRLEN                                           ~23     !5
         26        ASSIGN                                                   !6, ~23
   21    27        INIT_FCALL                                               'floor'
         28        SUB                                              ~25     !6, 21
         29        SEND_VAL                                                 ~25
         30        DO_ICALL                                         $26     
         31        ASSIGN                                                   !6, $26
   22    32        INIT_FCALL                                               'substr_replace'
         33        SEND_VAR                                                 !5
         34        SEND_VAL                                                 'jpg'
         35        SEND_VAR                                                 !6
         36        DO_ICALL                                         $28     
         37        ASSIGN                                                   !7, $28
   12    38    > > JMP                                                      ->10
         39    >   FE_FREE                                                  $15
   28    40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.04 ms | 1400 KiB | 19 Q