Difference in Accessing Arrays in PHP 5.3 and 5.4 or Some Configuration Mismatch

Difference in accessing arrays in PHP 5.3 and 5.4 or some configuration mismatch?

Array dereferencing, which is what you are using, was introduced in PHP 5.4 and won't work in PHP 5.3.

So

$dbSettings = $sm->get( 'Config' )[ 'doctrine' ][ 'connection' ][ 'orm_default' ][ 'params' ];

Would need to be:

$dbSettings = $sm->get( 'Config' );
$params = $dbSettings[ 'doctrine' ][ 'connection' ][ 'orm_default' ][ 'params' ];

Access to first json element

$json_decoded = json_decode($this->input->post('item_info'));
$data['item_domain'] = $json_decoded[0];

You have downgraded your PHP version. That syntax is only available from 5.4

how to pass index to php function for pdo

Your function parameters aren't correct.

Instead of:

public function eintrag($live_editor[$i], $match[$i])

You should have:

public function eintrag($live_editor_item, $match_item)

and in your function do:

$statement->execute([
':live_editor' => $live_editor_item,
':match' => $match_item,
]);

you function call will still be:

$eintragen = $storage_access->eintrag($live_editor[$i], $match[$i]);


Related Topics



Leave a reply



Submit