Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.
This repository was 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

Description

@flip111

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)) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions