[PHP 7.1.3] Yet another php bug with an array.

General discussion on PHP

[PHP 7.1.3] Yet another php bug with an array.

Postby timu1852 on Mon Mar 20, 2017 2:23 pm

Hello.

Yesterday I found a bug.
Briefly describe like this: have an array called $fetch = [ 'value' => 1 ], but if you do return $fetch['value'] - php we will report the lack of an index(offset).
Code: Select all
$query = $this->db->query("SELECT ?c FROM ?t WHERE ?c=?s LIMIT 1 LOCK IN SHARE MODE",
            'value', 'framework_settings', 'name', $name
        );
$fetch = $this-db->fetch($query); //Array ( [value] => 1 )
//return $fetch['value']; //Notice. Undefined index 'value'
//echo $fetch['value']; //1

But despite this, the index(offset) is present.


Also recorded video.
Code: Select all
$a = 'https:/\/';
$b = ['youtube', '.com'];

$a . $b[0] . $b[1] /watch?v=K276E_Qqcqc (Youtube link)

I'm used: Ubuntu 16.04 TLS Xenial, Apache 2, php 7.1.13

I hope for understanding.
timu1852
 
Posts: 2
Joined: Mon Mar 20, 2017 1:55 pm

Re: [PHP 7.1.3] Yet another php bug with an array.

Postby timu1852 on Mon Mar 20, 2017 3:16 pm

Understood. Please remove the topic.
timu1852
 
Posts: 2
Joined: Mon Mar 20, 2017 1:55 pm


Return to PHP

Who is online

Users browsing this forum: No registered users and 3 guests