Skip to content

[BUG] Wrong interface on compileSource leads to fatal error #16608

Closed

Description

@oleghind

protected function compileSource(string! viewCode, bool extendsMode = false) -> string

compileSource method returns string, but sometimes it returns array

Example:

                    if extendsMode {
                        let finalCompilation[] = block;
                    } else {
                        let finalCompilation .= block;
                    }
                }
            }

            return finalCompilation;

... which leads to a crash:
PHP Fatal error: Phalcon\Mvc\View\Engine\Volt\Compiler::compileSource(): Return value must be of type string, array returned

Better adjust interface to string | array

Activity

  1. changed the title [-]Wrong interface on compileSource leads to fatal error[/-] [+][BUG] Wrong interface on compileSource leads to fatal error[/+] on Jun 7, 2024
  2. self-assigned this
    on Jun 7, 2024
  3. added
    5.0The issues we want to solve in the 5.0 release
    and removed on Jun 7, 2024
  4. moved this to In Progress in Phalcon v5on Jun 7, 2024
  5. niden commented on Jun 7, 2024

    @niden
    SponsorMember

    Resolved in #16609

    Thank you @oleghind

  6. moved this from In Progress to Implemented in Phalcon v5on Jun 7, 2024
  7. added theissue type on Mar 6, 2025
  8. moved this from Implemented to Released in Phalcon v5on Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

5.0The issues we want to solve in the 5.0 releasebugA bug reportstatus: mediumMedium

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions