Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8058261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:17:50+00:00 2026-06-05T09:17:50+00:00

When running the following code: <?php $output = array(); exec(ping google.com, &$output); foreach ($output

  • 0

When running the following code:

<?php
    $output = array();
    exec("ping google.com", &$output);
    foreach ($output as $key => $value) {
        echo $value . "<br/>";
    }
?>

Getting Deprecated: as follows

 Call-time pass-by-reference has been deprecated in C:\xampp\htdocs\my_test\ajax_loop.php on line 3.

Please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:17:51+00:00Added an answer on June 5, 2026 at 9:17 am

    You need to drop the reference operator from &$output indeed.

    Few tutorials provides the syntax of functions as follows (exec in this example).

    string exec ( string $command [, array &$output [, int &$return_var ]] ) .
    

    The ‘&’ is not a reference operator, it only indicates that they are output variables, meaning you can expect the values of these variables to be populated with output data after the function call.
    In this case after the function call the $output array will be filled with all lines of output from the commnad which you try to execute. The $return_var will have the return status.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running the following php code; $output = exec('D:\TESTDIR\unrar.exe e D:\TESTDIR\Icons.rar -ppassword'); echo $output;
I am getting following output from running a php code, now i want to
I am getting the following error while running the code, Warning: require_once(product.php) [function.require-once]: failed
When running the following code I get no output but I cannot work out
Hi i am running the following code. foreach ($response as $object) { $basename =
I have this piece of code <ul> <?php $categories = get_categories('include=9,4,5,6,7,8,3&hide_empty=0'); foreach ($categories as
I tried running the following code: (http://localhost/read.php) <html> <body> <?php $link = mysql_connect('localhost', 'root',
I am running following PHP code to interact with a MS Access database. $odbc_con
I'm running the following code.... package com.dc; import android.app.Activity; import android.content.Intent; import android.net.Uri; import
Just as a demo, try the following code: <?php echo '<pre>'; ob_end_flush(); for($i=0;$i<2;$i++) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.