As mentioned in http://php.net/manual/en/language.types.array.php
Note. Starting with PHP 7.1.0, using an empty index operator in a string causes a fatal error. Previously, a string was seamlessly converted to an array.
Can someone please tell me what this means with an example?
How will this affect my code?
Thank!
In PHP <7.1:
$var = 'somestring'; $var[] = 'a'; # yields array with two elements ['somestring', 'a']
In PHP> = 7.1 this gives
Fatal error: Error on failure: [] operator is not supported for strings
, , 7.1, - , : 3v4l.org/V5YJa
:
<?php $rootbeer = ''; $rootbeer[] = 'T'; ?>
PHP 7.1.0:
Fatal error: Uncaught Error: [] operator not supported for strings in your_file.php:4 Stack trace: #0 {main} thrown in your_file.php on line 4
PHP PHP 7.0.1 .
, .
Source: https://habr.com/ru/post/1668830/More articles:OpenSSL not found on MacOS Sierra - phpGetting black plots with plt.imshow after multiplying an array of images by a scalar - pythonParallel fill std :: vector with zero - c ++Regex to remove only special special characters from a string - c #thread-safe CopyOnWriteArrayList reverse iteration - javaChanging image contrast in PIL - pythonBatch normalization on tensorflow - tf.contrib.layers.batch_norm works well in training, but the results of poor testing / verification - tensorflow//, How to run an R script from the built-in RStudio console? - open-sourceReading and writing to a file at the same time in C - cERROR: dependency proxy not available for package 'quanteda - rAll Articles