ircmaxell / ircmaxell/php-cfg

Referenced parameters not showing as referenced

Open
#39 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
247
Forks
45
Avg merge
1m
Merged PRs (30d)
1

Description

Should there be a way to tell if the argument was referenced?

Example:

<?php
function doNothing(&$var) {
$var = 'a';
}
$first = '1';
doNothing($first);
?>

Output

Block#1
    Stmt_Function<doNothing>
    Expr_Assign
        var: Var#1<$first>
        expr: LITERAL('1')
        result: Var#2
    Expr_FuncCall
        name: LITERAL('doNothing')
        args[0]: Var#1<$first>
        result: Var#3
    Terminal_Return
        expr: LITERAL(1)

Function doNothing():
Block#1
    Expr_Param
        name: LITERAL('var')
        result: Var#1<$var>
    Expr_Assign
        var: Var#2<$var>
        expr: LITERAL('a')
        result: Var#3
    Terminal_Return
        expr: LITERAL(NULL)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file, test, or entry point is named. Start by reproducing the PHP example and compare the argument at the call site with the parameter and assignment in the displayed CFG. Done means the output clearly indicates whether the referenced argument was referenced.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.