php-7

PHP 7: Missing VCRUNTIME140.dll

白昼怎懂夜的黑 提交于 2019-12-17 17:28:51
问题 I have an error when I start PHP 7 on Windows. When I run php on the command line, it returns a message box with system error: The program can't start because VCRUNTIME140.dll is missing from your computer. Try reinstalling the program to fix this problem. After that, CLI is crashing. As I don't want to install a DLL file from an external website, I don't know how to fix this! PHP version: 7.0.0alpha1 VC14 x64 Thread Safe 回答1: On the side bar of the PHP 7 alpha download page, it does say this

Colon after method declaration?

可紊 提交于 2019-12-17 16:11:52
问题 public function getRecords(int $id): array; Hi, can someone tell me what colon is doing here, in this method declaration inside PHP interface? Is this PHP 7 syntax and what array is meaning here? Method must return array or something else? 回答1: Yes it's new syntax introduced in PHP 7 to declare the method returns an array. http://php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration 回答2: These are called Return Type declarations in PHP7. It indicates the

What is <=> (the 'Spaceship' Operator) in PHP 7? [duplicate]

老子叫甜甜 提交于 2019-12-17 04:15:02
问题 This question already has answers here : Reference — What does this symbol mean in PHP? (18 answers) Closed 4 years ago . PHP 7, which will come out in November this year will introduce the Spaceship (<=>) operator. What is it and how does it work? This question already has an answer in our general reference question about PHP operators. 回答1: The <=> ("Spaceship") operator will offer combined comparison in that it will : Return 0 if values on either side are equal Return 1 if the value on the

Illegal offset type - Laravel 5.3 - ConnectionFactory.php - Every Model

那年仲夏 提交于 2019-12-14 03:54:37
问题 First sorry for bad english, not native. I'v an Laravel 5.3 App running on XAMPP, windows 7 machine. Everything was working great, and i don't have made any impact changes on code, it just happened. Everytime my app trys to build the connection with mysql this error is shown: FatalThrowableError in ConnectionFactory.php line 237: Illegal offset type in ConnectionFactory.php line 237 ConnectionFactory->createConnector(array('driver' => 'mysql', 'host' => '127.0.0.1', 'port' => '3306',

PHP login authentication not working

China☆狼群 提交于 2019-12-14 03:23:41
问题 I have two .php files. All html and php, no SQL and will not be needing/using it. One is the login page, the other is the destination. When I put in the log in details I have set, I can't get to the destination. As you can see, session_start(); is clearly at the top. I even put it right on the same line as the opening php tag and no difference was made. Here's the code for both pages: Login: <?php session_start(); $username="testu"; $password="testp"; $_SESSION['logged_in']=false; if (isset($

Why xdebug marks 587 and 588 as not executed and 589 as executed?

亡梦爱人 提交于 2019-12-13 23:57:37
问题 This is the chunk of code with the issue And this is the legend 回答1: I've understood what happens. The line 586 has multiple conditions and not all cases are covered and for those cases that are not covered 587 and 588 are listed as not executed. The legend should be updated though because is confusing. 来源: https://stackoverflow.com/questions/54828254/why-xdebug-marks-587-and-588-as-not-executed-and-589-as-executed

Connecting to 2nd gen Cloud SQL on App Engine flexible PHP 7.0 - missing socket

跟風遠走 提交于 2019-12-13 16:07:09
问题 I decided to try out PHP 7 on App Engine and have followed instructions here to connect to second gen Cloud SQL but I'm unable to get it working. As a testing script I decided to upload PhpMyAdmin and got the following error upon attempting to login: Then I decided to go into debug mode and see what's going on. Turns out that the proxy container is running, the /cloudsql/ folder is created but there is no socket there: Here is my app.yaml : runtime: php env: flex manual_scaling: instances: 1

PHP 7: Unicode escape syntax doesn't work on single quotes

蹲街弑〆低调 提交于 2019-12-13 09:13:01
问题 Whenever strings are set with single quotes the unicode doesn't get decoded but the unicode does get decoded when set with double quotes. How do I get the strings set by single quotes also to be decoded? PHP $poo = '\u{1F6BB}'; echo $poo; $poo = "\u{1F6BB}"; echo $poo; OUTPUT \u{1F6BB}🚻 Example http://sandbox.onlinephpfunctions.com/code/9a38e972226a6271996f512363c19332dae0b760 回答1: The point of single-quoted strings is that they don't support escape characters. The documentation says this

PHP is Missing mysql pdo Driver

元气小坏坏 提交于 2019-12-13 06:14:26
问题 I'm trying to run a Symfony 3 app with php 7 installed from source and I'm getting a Missing PDO driver exception. According to http://pecl.php.net/package/PDO_MYSQL the PDO_MYSQL extension is now part of PHP core. Q1.a) If I have the PDO_MYSQL extension (which I must, since its core) does that mean that I also have the mysql pdo driver? Q2.b) Is there further runtime configuration I have to do to make sure that the driver gets used? I've tried adding extension=php_pdo.so extension=php_pdo

PHP7.0 & Informix DB connectors

北城余情 提交于 2019-12-13 01:18:22
问题 I am trying to connect to an Informix db remotely via php7.0 I've found the driver https://pecl.php.net/package/PDO_INFORMIX/1.3.3 Downloaded the .tar.gz. and extracted it. Prepped the php files via phpize and ran ./configure as explained in: http://php.net/manual/en/ref.pdo-informix.php However, it crashes with the following error: checking for PDO includes... configure: error: Cannot find php_pdo_driver.h. I know that PDO has been a core PHP lib for a while and probably the C header file is