Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

Does not declare variable when used in preg_match function call #26

Open
flip111 opened this issue Jan 23, 2016 · 0 comments
Open

Does not declare variable when used in preg_match function call #26

flip111 opened this issue Jan 23, 2016 · 0 comments
Labels

Comments

@flip111
Copy link

flip111 commented Jan 23, 2016

php

if (! preg_match('some regex here', $subject, $regs)) {

zephir

if !(preg_match("some regex here", subject, regs)) {

this will crash zephir because regs was not declared and initialized before.

fix

var regs;
let regs = null;
if !(preg_match("some regex here", subject, regs)) {
@fezfez fezfez added the bug label Mar 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants