php-7.1

DB returns string instead of int (mysqlnd for PHP-7.1 / Laravel)

一笑奈何 提交于 2019-12-02 00:01:13
问题 A few days ago, I asked a question about a bug I found in Laravel. To fix it, I installed php5-mysqlnd on my server. Today, I upgraded my application to the latest php 7.1.*. Everything works correctly, except the bug is back again, i.e. integers in the database are returned as strings, which fails my strict comparison. I tried to find a package for mysqlnd for php 7.1 but there are none (yet?). But mysqlnd seems enabled though... phpinfo() PHP Version => 7.1.3-2+0~20170315222009.20+jessie~1

DB returns string instead of int (mysqlnd for PHP-7.1 / Laravel)

给你一囗甜甜゛ 提交于 2019-12-01 22:11:07
A few days ago, I asked a question about a bug I found in Laravel . To fix it, I installed php5-mysqlnd on my server. Today, I upgraded my application to the latest php 7.1.*. Everything works correctly, except the bug is back again, i.e. integers in the database are returned as strings, which fails my strict comparison. I tried to find a package for mysqlnd for php 7.1 but there are none (yet?). But mysqlnd seems enabled though... phpinfo() PHP Version => 7.1.3-2+0~20170315222009.20+jessie~1.gbpc7e7dd System => Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 mysqlnd

How should a PHP thread store its data?

蹲街弑〆低调 提交于 2019-12-01 21:11:38
So I have been googling and reading up and down the internet about PHP pthreads3 and how they are supposed to store data. (Or rather, how they are not) It seems to me that the only way for a thread to store its data properly is to create a new Threaded object and send it to the thread. The thread can then use this Threaded object to store nearly any data. My question, and biggest issue with grasping PHP threads: Is it possible to have the thread create its own storage objects when it wants? I have no idea how or why, since all the answer I've found on this tell a vague, elaborate and confusing

Function mcrypt_create_iv() is deprecated within CodeIgniter framework

微笑、不失礼 提交于 2019-12-01 20:54:26
<?php class Encryption { var $skey = "1234561234561234"; // you can change it public function safe_b64encode($string) { $data = base64_encode($string); $data = str_replace(array('+','/','='),array('-','_',''),$data); return $data; } public function safe_b64decode($string) { $data = str_replace(array('-','_'),array('+','/'),$string); $mod4 = strlen($data) % 4; if ($mod4) { $data .= substr('====', $mod4); } return base64_decode($data); } public function encode($value){ if(!$value){return false;} $text = $value; $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); $iv = mcrypt

PHP 7.1.x - mysqli_connect Isn't Defined (Extension is turned on)

倾然丶 夕夏残阳落幕 提交于 2019-12-01 05:37:24
Background I have WAMP Server (3.0.6) installed on my Windows 10 computer. I am developing a WordPress site using a few custom MySQL tables, so I'm using $wpdb . Problem I was running on PHP 7.0.10, and everything was fine. This morning, I installed PHP 7.1.4, and suddenly I got this error: Fatal error: Uncaught Error: Call to undefined function mysql_connect() in ...\wp-includes\wp-db.php:1573 I dug into it and traced the issue back to the __construct() function, and this if statement: if ( function_exists( 'mysqli_connect' ) ) { A var_dump showed me that function_exists( 'mysqli_connect' )

PHP 7.1.x - mysqli_connect Isn't Defined (Extension is turned on)

元气小坏坏 提交于 2019-12-01 03:01:02
问题 Background I have WAMP Server (3.0.6) installed on my Windows 10 computer. I am developing a WordPress site using a few custom MySQL tables, so I'm using $wpdb . Problem I was running on PHP 7.0.10, and everything was fine. This morning, I installed PHP 7.1.4, and suddenly I got this error: Fatal error: Uncaught Error: Call to undefined function mysql_connect() in ...\wp-includes\wp-db.php:1573 I dug into it and traced the issue back to the __construct() function, and this if statement: if (

PHP Traversable type hint

只愿长相守 提交于 2019-11-30 17:16:40
I have a relatively simple function which uses a foreach function foo($t) { $result; foreach($t as $val) { $result = dosomething($result, $val); } return $result; } I would like to type hint, and Traversable seems to be the exact type hint I need function foo(Traversable $t) { However this gives a E_RECOVERABLE_ERROR when using an array (which is of course usable in a foreach ): example Argument 1 passed to foo() must implement interface Traversable, array given Is there a way to type hint or is this not possible? Andrea PHP 7.1 introduces the iterable type declaration for this purpose, which

How to install bcmath in Ubuntu for PHP 7.1

◇◆丶佛笑我妖孽 提交于 2019-11-30 14:56:49
问题 I'm using an Ubuntu 16 server for testing with php7.1 . One of my app uses bcadd function. I know that I need to install bcmath module for that but I'm unable to find php7.1-bcmath . When I tried to install apt install php-bcmath , it simply installed php7.0-bcmath module. I was unable to find php7.1-bcmath module anywhere to install on my server. Does anybody has an idea? apt install php7.1-bcmath returned following, E: Unable to locate package php7.1-bcmath E: Couldn't find any package by

Switch php versions on commandline ubuntu 16.04

◇◆丶佛笑我妖孽 提交于 2019-11-28 15:12:40
I have installed php 5.6 and and php 7.1 on my Ubuntu 16.04 I know with Apache as my web server, I can do a2enmod php5.6 #to enable php5 a2enmod php7.1 #to enable php7 When I disable php7.1 in Apache modules and enable php 5.6, Apache recognizes the change and uses php 5.6 interpreter as expected. But when I run internal php web server from the commandline: php -S localhost:8888 php handles requests using php 7, how do I switch between php 6.6 and php 7.1 in the commandline ? Interactive switching mode sudo update-alternatives --config php Manual Switching From PHP 5.6 => PHP 7.1 Default PHP 5

Codeigniter 3 Session not working With PHP 7.1.4

巧了我就是萌 提交于 2019-11-28 01:20:45
I have an application built with Codeigniter 3 HMVC .The application was working fine on PHP 5.6 version, But after upgrading my PHP version to 7.1.4 I was not able to log in into my application. After a complete checkup I found that session is not setting at all. I role back to PHP 5.6 and session was working fine again while switching to PHP 7.1.4 bring the "session not working" issue back. I tried altering some config value like cookie prefix and cookie save name etc, nothing seems to fix it. Can anyone please help. A1ft I found that the issue is with some earlier version of Codeigniter 3